const Router = require('koa-router');
const router = new Router();
const {db, Op, QueryTypes} = require("../../models/db");
// 商品历史价格
router.post('/bill/getBillNoById', async ctx => {
    let user = ctx.user
    let body = ctx.request.body
    let tenantId = user.tenantId;
    let id = body.id;
    let model = await db.models['invoice'].findOne({
        where: {
            tenantId,
            id
        },
        attributes: ['billNo']
    })
    if(!model) return ctx.err('没找到单据')
    return ctx.suc('', model.billNo)

})

module.exports = router;